/*
 * file_receiver.h
 *
 *  Created on: 2009-1-7
 *      Author: fanliangliang
 */

#ifndef FILE_RECEIVER_H_
#define FILE_RECEIVER_H_

#include "toxic.h"
#include "queueable_thread.h"
#include <vector>
#include <string>

using toxic::TcpSocket;
using std::vector;
using std::string;

// forward declaration
class FileSender;
class Uncompressor;

class FileReceiver : public QueueableThread<TcpSocket*> {
public:
	FileReceiver(FileSender* sender, Uncompressor* uncompressor);
	virtual ~FileReceiver();
	virtual void process(TcpSocket* socket);

private:
	bool receiveFile(TcpSocket* socket);

private:
	FileSender* sender_;
	Uncompressor* uncompressor_;
	vector<string> tempFiles_;
};

#endif /* FILE_RECEIVER_H_ */
